package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2023-05-13
 * Time: 12:02
 */
abstract class Shape{
    /*public void draw(){
        System.out.println("画图形！");
    }*/
    public abstract void draw();
}
class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形！");
    }
}
/*abstract class Rect extends Shape {

}
class A extends Rect{
    @Override
    public void draw() {

    }
}*/
class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆！");
    }
}
class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画一朵花❀！");
    }
}
public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        //hape shape = new Shape();
        drawMap(new Rect());
        drawMap(new Cycle());
        drawMap(new Flower());
    }
}
